<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 */
class Region_model extends MY_Model{
	
	public function __construct() {
		parent::__construct();
		$this->tbl = 'ey_commdata_region';
		$this->tbl_key = 'regionid';
		$this->tbl_ext = '';
	}

	public function getProvince()
	{
		return $this->L(array('regiontype'=>'1'), 'regionid as id, name, parentid', '50');
	}

	public function getCity($provinceid)
	{
		return $this->L(array('regiontype'=>'2', 'parentid'=>$provinceid), 'regionid as id, name, parentid', '50');
	}

	public function getRegion($cityid)
	{
		return $this->L(array('regiontype'=>'3', 'parentid'=>$cityid), 'regionid as id, name, parentid', '50');
	}

}
